package com.codegeek.project.slope.service.impl;

import com.codegeek.project.slope.domain.SlopeItemHistory;
import com.codegeek.project.slope.mapper.SlopeItemHistoryMapper;
import com.codegeek.project.slope.service.ISlopeItemHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 监测项历史数据Service业务层处理
 *
 * @author codegeek
 * @date 2020-02-17
 */
@Service
public class SlopeItemHistoryServiceImpl implements ISlopeItemHistoryService {
    @Autowired
    private SlopeItemHistoryMapper slopeItemHistoryMapper;

    /**
     * 查询监测项历史数据
     *
     * @param itemHistoryId 监测项历史数据ID
     * @return 监测项历史数据
     */
    @Override
    public SlopeItemHistory selectSlopeItemHistoryById(Long itemHistoryId) {
        return slopeItemHistoryMapper.selectSlopeItemHistoryById(itemHistoryId);
    }

    /**
     * 查询监测项历史数据列表
     *
     * @param slopeItemHistory 监测项历史数据
     * @return 监测项历史数据
     */
    @Override
    public List<SlopeItemHistory> selectSlopeItemHistoryList(SlopeItemHistory slopeItemHistory) {
        return slopeItemHistoryMapper.selectSlopeItemHistoryList(slopeItemHistory);
    }

    /**
     * 新增监测项历史数据
     *
     * @param slopeItemHistory 监测项历史数据
     * @return 结果
     */
    @Override
    public int insertSlopeItemHistory(SlopeItemHistory slopeItemHistory) {
        return slopeItemHistoryMapper.insertSlopeItemHistory(slopeItemHistory);
    }

    /**
     * 修改监测项历史数据
     *
     * @param slopeItemHistory 监测项历史数据
     * @return 结果
     */
    @Override
    public int updateSlopeItemHistory(SlopeItemHistory slopeItemHistory) {
        return slopeItemHistoryMapper.updateSlopeItemHistory(slopeItemHistory);
    }

    /**
     * 批量删除监测项历史数据
     *
     * @param itemHistoryIds 需要删除的监测项历史数据ID
     * @return 结果
     */
    @Override
    public int deleteSlopeItemHistoryByIds(Long[] itemHistoryIds) {
        return slopeItemHistoryMapper.deleteSlopeItemHistoryByIds(itemHistoryIds);
    }

    /**
     * 删除监测项历史数据信息
     *
     * @param itemHistoryId 监测项历史数据ID
     * @return 结果
     */
    @Override
    public int deleteSlopeItemHistoryById(Long itemHistoryId) {
        return slopeItemHistoryMapper.deleteSlopeItemHistoryById(itemHistoryId);
    }

    @Override
    public SlopeItemHistory selectSlopeItemHistoryByItemIdAndDate(Long itemId, String date) {
        return slopeItemHistoryMapper.selectSlopeItemHistoryByItemIdAndDate(itemId, date);
    }

    @Override
    public List<SlopeItemHistory> selectSlopeItemHistoryList2(SlopeItemHistory slopeItemHistory) {
        return slopeItemHistoryMapper.selectSlopeItemHistoryList2(slopeItemHistory);
    }
}
